#ifndef FRACALCDATAITEM_H
#define FRACALCDATAITEM_H

#include <QPoint>
#include <QSet>

class FrakOutDataItem
{
public:
    FrakOutDataItem();
    FrakOutDataItem(double cellSize);
    FrakOutDataItem(double cellSize, const QSet<QPair<int,int> >& cells);

public:
    void addCell(const QPair<int,int>& cell);
    const QSet<QPair<int,int> >& cells() const;
    bool cellExists(const QPair<int,int>& cell) const;
    double cellSize() const;
    void clearCells();
    int numCells() const;
    void removeCell(const QPair<int,int>& cell);
    void setCells(const QSet<QPair<int,int> > cells);
    void setCellSize(double cellSize);

private:

    /**
      * A collection of cell coordinates. These are the cells that are overlaid
      * on the pixmap.
      */
    QSet<QPair<int,int> > m_cellData;

    /** The side length of a square cell. */
    double m_cellSize;

    /** The fractal dimension of this item. */
    double m_fractalDimension;
};

/** Output operator. */
QDataStream& operator<<(QDataStream& out, const FrakOutDataItem& fracalcDataItem);

/** Input operator. */
QDataStream& operator>>(QDataStream &in, FrakOutDataItem& fracalcDataItem);

#endif // FRACALCDATAITEM_H
